package com.woniuxy.utils;

import java.io.File;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author zhang
 * @create 2021-08-12-18:41
 */
public class GUtils {
    public static String getNow() {
        DateTimeFormatter sdf = DateTimeFormatter.ofPattern("yyyy-MM-hh HH:mm:ss");
        return sdf.format(LocalDateTime.now());
    }
    public static boolean isEmpty(String s) {
        return s==null||s.trim().equals("");

    }
    public static boolean isNotEmpty(String s) {
        return !isEmpty(s);

    }

    /**
     * 创建存储图片的文件夹
     */
    public static void createDirectory(){
        //创建文件夹
        File file1=new File("D://gfrimages");
        if(!file1.exists()){//如果文件夹不存在
            file1.mkdir();//创建文件夹
        }
    }
}
